(deftemplate Pc
    (slot porneste)
    (slot seAudeBipuit)
    (slot seAudeFasait)
    (slot seAudeBatand)
    (slot ieseFum)
    (slot temperaturaProcesor)
    (slot temperaturaPlacaVideo)
    (slot temperaturaPlacaDeBaza)
)

(assert (Pc (porneste nil)))

(defrule inserare
	(Pc (porneste nil))
    
    =>

    (printout t "Porneste ? (DA/NU)" crlf)
	(bind ?r (read))
    
    (printout t "Se aude Bipuit ? (DA/NU)" crlf)
	(bind ?r2 (read))
    
    (printout t "Se aude fasait ? (DA/NU)" crlf)
	(bind ?r3 (read))
    
    (printout t "Se aude batand ? (DA/NU)" crlf)
	(bind ?r4 (read))
    
    (printout t "Iese fum ? (DA/NU)" crlf)
	(bind ?r5 (read))
    
    (printout t "Cat este temperatura procesorului ? (Gradre celsius)" crlf)
	(bind ?r6 (read))
    
    (printout t "Cat este temperatura placii video ? (Grade celsius)" crlf)
	(bind ?r7 (read))
    
    (printout t "Cat este temperatura placii de baza ? (Grade celsius)" crlf)
	(bind ?r8 (read))
	(assert (Pc 
            	(porneste ?r) 
            	(seAudeBipuit ?r2)
            	(seAudeFasait ?r3)
            	(seAudeBatand ?r4)
            	(ieseFum ?r5)
            	(temperaturaProcesor ?r6)
            	(temperaturaPlacaVideo ?r7)
            	(temperaturaPlacaDeBaza ?r8)
            )
        	
	)
)

(defrule sursa
    (declare (salience 10))
	?id <- (Pc (porneste NU))
    
    
    
    =>
                
   	(printout t "Aveti probleme cu sursa! "crlf)
 	(retract ?id)
    
)

(defrule TP
    (declare (salience 9))
	?id <- (Pc (temperaturaProcesor ?t))
    (test (> ?t 75))
    
    =>
                
   	(printout t "Nu functioneaza coolerul de pe procesor! "crlf)
    (retract ?id)
    
)

(defrule default
    
    (Pc (porneste ))
    =>
    
    (printout t "Nu sunt solutii pentru problema dumneavoastra!" crlf)
)

(defrule serios
    (declare (salience 2))
	?id <- (Pc (ieseFum DA))   
   
    =>
    
    (printout t "Sper ca glumesti!" crlf) 
	(retract ?id)
)

(defrule bomba
    (declare (salience 1))
	?id <-(Pc (seAudeBipuit DA))
    
    =>
    
    (printout t "o sa EXPLODEZE, FUGI !!!" crlf)    
    (retract ?id)
)



(run)
